package com.xuecheng.content.api;

import com.xuecheng.commons.model.vo.CoursePubVo;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.commons.model.vo.TeachplanVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author Sober_wxy
 * @date 2022/7/25 15:32
 */
@FeignClient("xc-content-service")
public interface ContentClient {
        /**
         * 查询所有发布课程
         * @return List<CoursePubVo>
         */
        @GetMapping("/coursePub/findAll")
        ResponseResult<List<CoursePubVo>> findAll();

        /**
         * 根据id 查询发布的课程
         * @param id 课程id
         * @return CoursePubVo
         */
        @GetMapping("/coursePub/{id}")
        ResponseResult<CoursePubVo> findById(@PathVariable("id") Long id);

        @GetMapping("/teachplan/{teachplanId}")
        ResponseResult<TeachplanVo> findPlanById(@PathVariable("teachplanId") Long teachplanId);
}
